﻿using Orleans;
using Orleans.Runtime;
using Orleans.Runtime.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Sample.GrainService
{
    public class DataServiceClient : GrainServiceClient<IDataService>, IDataServiceClient
    {
        public DataServiceClient(IServiceProvider serviceProvider) : base(serviceProvider)
        {
        }


        Task<int> IDataService.MyMethod()
        {
            return Task.FromResult(222);
        }
    }

    public class MyNormalGrain //: Grain<NormalGrainState>, INormalGrain
    {

        readonly IDataServiceClient DataServiceClient;

        /// <summary>
        /// Grain 使用服务方式
        /// </summary>
        /// <param name="grainActivationContext"></param>
        /// <param name="dataServiceClient"></param>
        public MyNormalGrain(IGrainActivationContext grainActivationContext, IDataServiceClient dataServiceClient)
        {
            DataServiceClient = dataServiceClient;
        }
    }
}
